<script type="text/javascript">
//<![CDATA[

$(function(){
	$('#swfupload-control').swfupload({
		upload_url: "/profile/index/upload-images",
		file_post_name: 'vfile',
		file_size_limit : "3 MB",
		file_upload_limit : 1,
		file_types : "*.jpeg;*.gif;*.doc;*.xls;*.ppt;*.png;*.jpg",
		file_types_description : "Files",
		flash_url : "/scripts/swfupload/swfupload.swf",
		button_image_url : "http://www.swfupload.org/button_sprite.png", 
		button_width : 61, button_height : 22, 
		button_text : "<span class='redText'>Attach File</span>", 
		button_text_style : ".redText { color:#53b3e6; font:normal 12px arial;}", 
		button_cursor : SWFUpload.CURSOR.HAND,
		button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_text_left_padding : 3, 
		button_text_top_padding : 2,		
		button_width : 114,
		button_height : 29,
		button_placeholder : $('#button')[0],
		debug: false
		//alert(upload_url);exit; 
	})
			.bind('fileQueued', function(event, file){
          	var imgfile = file.name;
			var listitem='<li id="'+file.id+'">';
				if(imgfile.length > 40)
			 {
				listitem+='File: <em>'+(imgfile.slice(0, 20))+'...'+imgfile.slice(-10)+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>';
				}else{
				listitem+='File: <em>'+imgfile+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>';
				}
				listitem+='<div class="progressbar" ><div class="progress" ></div></div>'+
				'<p class="status" >Pending</p>'+
				'<span class="addarticle" ></span>&nbsp;&nbsp;'+
				'<span class="cancel" >&nbsp;</span>'+
				'</li>';
			$('#log11').append(listitem);
			$('li#'+file.id+' .cancel').bind('click', function(){
				var swfu = $.swfupload.getInstance('#swfupload-control');
				swfu.cancelUpload(file.id);
				$('li#'+file.id).slideUp('fast');
			});
			// start the upload since it's queued
			$(this).swfupload('startUpload');
			
		})
		.bind('fileQueueError', function(event, file, errorCode, message){
			
			try {
					if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
							alert("" + (message === 0 ? "You have reached the upload limit." : "You can upload " + (message > 1 ? "up to " + message + " files." : "one file only.")));
							return;
					}

					switch (errorCode) {
					case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
							alert('Size of the file '+file.name+' is greater than limit');
							break;
					case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
							alert('Size of the file '+file.name+' is too low');
							break;
					case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
							alert("Invalid file type selected. ");
							break;
					default:
							if (file !== null) {
												}
							alert("Invalid file selected. ");
							break;
					}
				} catch (ex) {
					alert(ex);
				}

		})	
		.bind('uploadStart', function(event, file){
			$('#log11 li#'+file.id).find('p.status').text('Uploading...');
			$('#log11 li#'+file.id).find('span.progressvalue').text('0%');
			$('#log11 li#'+file.id).find('span.cancel').hide();
		})
		.bind('uploadProgress', function(event, file, bytesLoaded){		
			var percentage=Math.round((bytesLoaded/file.size)*100);
			$('#log11 li#'+file.id).find('div.progress').css('width', percentage+'%');
			$('#log11 li#'+file.id).find('span.progressvalue').text(percentage+'%');
		})
		.bind('uploadSuccess', function(event, file, serverData){
		//alert(serverData);
			var divId = parseInt(document.getElementById('hidCount1').value);
			addFile(serverData,'1',file.id);
			document.getElementById('filenm').value = serverData;
			var item=$('#log11 li#'+file.id);
			item.find('div.progress').css('width', '100%');
			item.find('span.progressvalue').text('100%');
			item.addClass('success').find('p.status').html('Completed!!! ');
			var name = serverData.split(".",2);
			var actimgName = serverData.split("_-_",2);
			var cleanimgactName = (actimgName[1].replace(/_/g," "));
			item.addClass('success').find('p.status').append(cleanimgactName+'<a class="wht_bt"  href="javascript:void(0)"  onclick="deleteBlock(\''+divId+'\',\''+trim(serverData)+'\',\'1\');" ><span><img src="/images/CloseIcon.png" alt="cross" id="close_1" class="align_X img_pointer"/></span></a>');;
			//item.addClass('success').find('span.addarticle').html('<a href="javascript:addToArticle(\''+serverData+'\');">Insert into article</a>');
		})
		.bind('uploadComplete', function(event, file){
			$(this).swfupload('startUpload');
		})
		
	
});	
function change_bg(liid)
  {
	//alert(liid);
	 var arr=document.getElementById("mycolorband").getElementsByTagName("a");
	 //alert(arr.length);
	 for(var i=0;i<arr.length;i++)
	 {
		 aid=arr[i].id;
		 if(aid==liid)
		 {
			document.getElementById(aid).setAttribute('class','active');
			 //document.getElementById(aid).style.background="url(/images/color_image/"+aid+".png)";
		 }
		 else
		 {
			 document.getElementById(aid).removeAttribute('class','active');
		 }
	 }
  }
	  
function addFile(fileName,i,swfid)
{
	var divId = parseInt(document.getElementById('hidCount'+i).value);
	document.getElementById('hidCount'+i).value = parseInt(document.getElementById('hidCount'+i).value) + 1;
	oItemThumbDiv = document.createElement('div');
	oItemThumbDiv.style.width = "200px";
	oItemThumbDiv.style.paddingLeft = "120px";
	oItemThumbDiv.setAttribute('name','content_'+i+'_'+divId);
	oItemThumbDiv.setAttribute('id','content_'+i+'_'+divId);
	oItemThumbDiv.setAttribute('bgcolor',"#ccf9b9");
	var name = fileName.split(".",2);
	var actimgName = fileName.split("_-_",2);
	var cleanimgactName = (actimgName[1].replace(/_/g," "));
	//alert(fileName);
	//alert(actimgName);
	//oItemThumbDiv.innerHTML = '<div style="width:466px; height:auto; float:left;"><input type="hidden" name="fileNames'+'[]" value="'+fileName+'"/><input type="hidden" name="featured_values'+'[]" id="hid_'+swfid+'" value="0" /><div class="bor_bot_1 pad_tb_10"><div class="float_l width_9 pad_t_40"><img src="/images/delet_ad_icon.png" onclick="deleteBlock(\''+divId+'\',\''+fileName+'\',\''+i+'\');"/></div><div class="float_l width_5 pad_t_40">';
	if(cleanimgactName.length > 40) {
	cleanimgactName=(cleanimgactName.slice(0, 20))+'...'+cleanimgactName.slice(-10);
	} else{
	cleanimgactName= cleanimgactName;
	}
	//oItemThumbDiv.innerHTML = '<div style="width:545px; height:auto; float:left; border:0px solid #f00;"><input type="hidden" name="fileNames'+'[]" value="'+fileName+'"/><div class="bor_bot_1 pad_tb_10"><div class="float_l width_5 pad_t_40">'+cleanimgactName[1].replace(/_/g," ")+'</div></br><div class="clear"></div><div class="float_l width_7" id="'+name[0]+'"><img src="/Uploads/exercise/images/'+fileName+'" onclick="javascript:void(0);return false;" height="90" width="90" /></div><div class="float_l width_9 pad_t_40"><a class="wht_bt"  href="javascript:void(0)"  onclick="deleteBlock(\''+divId+'\',\''+fileName+'\',\''+i+'\');" ><span>Remove</span></a></div><div class="clear"></div></div></div>';
	oItemThumbDiv.innerHTML+='</div><input type="hidden" name="fileNames'+'[]" value="'+fileName+'"/><div id="'+name[0]+'"></div><div class="clear"></div></div></div>';
	document.getElementById('content_upload'+i).appendChild(oItemThumbDiv);
	$('#profile_image').html('<img  src="/Uploads/users/thumbs/'+trim(fileName)+'" width="150" height="150"/>');
	$("#swfupload-hidden_container").hide();
		$("#swfupload-replaced").html('<img src="/images/swf_upload.gif" />');
		
}
function updatePhoto()
{
	if($('#hidCount1').val()==0)
	{
		alert("${php: this.translate('errmsg_uploadone_photo')}");
		return false;
	}
	else if($('#hidCount1').val()>1)
	{
		$('#hidCount1').val(0);
		alert("${php: this.translate('errmsg_selectone_photo')}");
		return false;
	}
	var image=$('#filenm').val();
	//return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "image="+image,
			    url: "/profile/index/update-profile/",
			    success: function(data){
					//var change_div=
					//alert(data.output);return false;
					var changed_image=data.output;
					$('#profile_image').html('<img  src="'+changed_image+'" width="150" height="150"/>');
					$('#hidCount1').val('');
									
				}
			});
}
function addToArticle(id)
{
	var divId = id.split('.');
    var image_div = $('#'+divId[0]).html();
	//FCKeditorAPI.GetInstance('description').InsertHtml(image_div);   
}
//Function for deleting the image block
function deleteBlock(divid,filename,i)
{ 
	//alert(i);
	if(confirm('Do you really want to delete ?')) {
		$.ajax({
		type: "POST",
		dataType: "json",
		url: "/expressions/index/remove?filename="+filename,
		success: function(data){
		reletedDetails = data;
		}
		});
	document.getElementById('content_upload'+i).removeChild(document.getElementById('content_'+i+'_'+divid));
	var m=parseInt(i)-1;
	document.getElementById('SWFUpload_'+m+'_'+divid).style.display = 'none';
	} else {
		return false;
	}


}

//]]>
</script>
<div id="blockContIn">
<table border="0" cellspacing="0" cellpadding="0" align="left" width="100%">
  <tr>
    
	<td valign="top" width="100%"><div class="ColExp">
<div class="ModuleBlock">
<h1>
<label>Rajeshbabu Daggubati</label>
<div style="margin-top:-8px;"><a href="#" class="Msg">Message</a></div>
<div style="margin-top:-8px;"><a href="#" class="AddFrnd">Add Friends</a></div>
</h1>
<div class="clear"></div>
<div class="pad_a">
<div class="Fleft pad_r15">
<div class="MarBot10" id="profile_image">
<?php if($_SESSION["sess_photo"]!="") { ?>
<img id="profileimg" name="profileimg" src="<?php echo $ctx->thumbImgPath.$_SESSION['sess_photo']; ?>" width="150" height="150"/>
<? }else { ?>
<img id="profileimg" name="profileimg" src="/images/ProfileDefUser.gif" width="150" height="150"/>
<? } ?>

		<div class="clear"></div>
</div>
<div class="">
		<p id="swfupload-control"><a class="Button" href="javascript:void(0);" onclick="updatePhoto();"><span>Save</span></a></p>
				<input type="button" id="button"/>
				<input type="hidden" name="filenm" id="filenm" value="0" />
				<input type="hidden" name="hidCount1" id="hidCount1" value="0" />
				
				<p id="content_upload1"></p>
				<p class="float_l pad_l_10" id="swfupload-replaced"></p>
		
</div>
<div>
<div class="BlkTitle">Friends</div>
<div class="BlkBg MarBot10">
<ul class="ProfFrnd">
<li><img src="/images/41718_100000932479641_1300979151_n.jpg" title="Bhanu" alt="Bhanu"/></li>
<li><img src="/images/157183_1186029223_677922353_n.jpg" title="Harinath" alt="Harinath"/></li>
<li><img src="/images/173504_100001443132323_1949222_n.jpg" title="Suni" alt="Suni"/></li>
<li><img src="/images/186063_1492023334_3708330_n.jpg" title="Ashish" alt="Ashish"/></li>
<li><img src="/images/203435_1012640661_3181031_n.jpg" title="Bobby" alt="Bobby"/></li>
<li><img src="/images/274869_100001220896895_1151974492_n.jpg" alt="Vidhya" title="Vidhya"/></li>
<li><img src="/images/369475_1400720054_1747754849_n.jpg" title="Sam" alt="Sam"/></li>
<li><img src="/images/173504_100001443132323_1949222_n.jpg" title="Rajesh" alt="Rajesh"/></li>
<li><img src="/images/157183_1186029223_677922353_n.jpg" alt="Harinath" title="Harinath"/></li>
<div class="clear"></div>
</ul>
<div align="right" class="txt_sm"><a href="#">See All >></a></div>
</div>
</div>
<div>
<div class="BlkTitle">Your Brands</div>
<ul class="brands">
<li><a href="#"><img src="/images/brand1.gif"/></a></li>
<li><a href="#"><img src="/images/brand2.gif"/></a></li>
<li><a href="#"><img src="/images/brand3.gif"/></a></li>
<li><a href="#"><img src="/images/brand4.gif"/></a></li>
<li><a href="#"><img src="/images/brand5.gif"/></a></li>
<li><a href="#"><img src="/images/brand6.gif"/></a></li>
</ul>

</div>
</div>
<div class="Fleft wid40per RtBorder">
<div class="BotBorder MarBot10 pad_b10">
<div class="BlkTitle">Your Status</div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in vol</div>
<div class="clear"></div>
</div>
<div>
<ul class="ModuleMenu">
<li><a href="#" class="active">Network Activity </a> </li>
<li><a href="#">Photos</a> </li>
</ul>
<div class="clear"></div>
<input type="text" value="Share Something"  class="share"/>

<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">Lorem ipsum dolor sit amet, consectetur sit amet, consectetur</p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/TrigIcon.png" alt="Expression" title="Expression"/></div>
<div class="clear"></div>
</div>
<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">Lorem ipsum dolor sit amet, consectetur sit amet, consectetur</p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/TrigIcon.png" alt="Expression" title="Expression"/></div>
<div class="clear"></div>
</div>
<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p><img src="/images/VideoImg.jpg"/></p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/VideoIcon.png" alt="Expression" width="14" height="14" title="Expression"/></div>
<div class="clear"></div>
</div>
<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">Lorem ipsum dolor sit amet, consectetur sit amet, consectetur</p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/TrigIcon.png" alt="Expression" title="Expression"/></div>
<div class="clear"></div>
</div>
<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">Lorem ipsum dolor sit amet, consectetur sit amet, consectetur</p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/TrigIcon.png" alt="Expression" title="Expression"/></div>
<div class="clear"></div>
</div>
<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p><img src="/images/VideoImg.jpg"/></p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/VideoIcon.png" alt="Expression" title="Expression"/></div>
<div class="clear"></div>
</div>
<div class="activity">
<div class="blkCont">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p><img src="/images/PhotoImg.jpg"/></p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="blkContRt">
<img src="/images/PhotoIcon.png" alt="Expression" width="14" height="10" title="Expression"/></div>
<div class="clear"></div>
</div>

<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="Fleft wid40per pad_115">
<div class="MarBot10"><img src="/images/cup.gif" width="335" height="141"/></div>
<div class="MarBot10">
<div>
<ul class="ModuleMenu">
<li><a href="#" class="active">Activity </a> </li>
<li><a href="#">Deals </a> </li>
<li><a href="#">Photos</a> </li>
</ul>
<div class="clear">&nbsp;</div>
<div class="ProfActv">
  <div class="blkContImg">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">Lorem ipsum dolor sit amet, consectetur sit amet, consecteturpsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.nisi ut aliquip</p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="ProfActv">
<div class="blkContImg">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">
  <img src="/images/blue-fish-thumb.jpg" />&nbsp;<img src="/images/coral-reef-thumb.jpg" />&nbsp;<img src="/images/yellow-fish-thumb.jpg" /></p>
<div class="Fleft">
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span>
</div>
<div class="Fright pad_r15"><a href="#" class="txt_sm" >View All</a></div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="ProfActv">
<div class="blkContImg">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#">Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">Lorem ipsum dolor sit amet, consectetur sit amet, consecteturpsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.nisi ut aliquip</p>
<div>
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span></div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="ProfActv">
<div class="blkContImg">
<p class="UserImg"><img src="/images/ListUserImg.jpg" /></p>
<p class="Date"> 5 Apr 2012</p>
</div>
<div class="blkCont">
<div>
<p class="Title"><a href="#" >Lorem ipsum dolor sit amet, curdolor dolor ...</a></p>
<p class="Desc">&nbsp;&nbsp;<img src="/images/ProfActVid.png" /></p>
<div class="Fleft">
<span><a href="#" class="UserShare">Share</a></span>
<span><a href="#" class="UserComment">Comment</a></span>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>


<div class="clear"></div>
</div>
</div>
</div></td>
	
  </tr>
</table>





<div class="clear"></div>
</div>
